﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Plumbing;
using Autodesk.Revit.UI.Selection;
using YArchitech.Revit;

namespace YArchitech.HVAC
{
	public class SprinklersPipeSelectionFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			if (elem is Pipe)
			{
				PipeSystemType systemType = ((elem as Pipe).MEPSystem as PipingSystem).SystemType;
                if (!YJKRevitTools.isRiserPiping(elem) && (int)systemType == 23)
				{
					return true;
				}
			}
			return false;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			return false;
		}
	}
}
